#ifndef USER_MANAGER_H
#define USER_MANAGER_H

#include "../databaseManager/DatabaseManager.h"
#include "../utils/util.h"
#include <string>
#include <iomanip>
#include <iostream>
using namespace std;

class DatabaseManager;

class UserManager
{
public:
    // 构造函数
    UserManager();
    void showUserInfo();

    // getter and setter
    int getId() const { return id; }
    void setId(int id) { this->id = id; }
    string getUsername() const { return username; }
    void setUsername(string username) { this->username = username; }
    string getPassword() const { return password; }
    void setPassword(string password) { this->password = password; }
    string getRole() const { return role; }
    void setRole(string role) { this->role = role; }
    int getIsActive() const { return is_active; }
    void setIsActive(int is_active) { this->is_active = is_active; }
    int getIsDeleted() const { return is_deleted; }
    void setIsDeleted(int is_deleted) { this->is_deleted = is_deleted; }
    string getCreatedOn() const { return created_on; }
    void setCreatedOn(string created_on) { this->created_on = created_on; }
    string getUpdatedOn() const { return updated_on; }
    void setUpdatedOn(string updated_on) { this->updated_on = updated_on; }

    // 登录
    int login(UserManager *user);

private:
    int id;
    string username;
    string password;
    string role;
    int is_active;
    int is_deleted;
    string created_on;
    string updated_on;
    string getCurrentTime();
};
#endif